#include "Wall.h"


Wall::Wall(int x, int y) :
	GameObject(x, y, Type_Wall)
{
}

void Wall::drawObject(int row, int col) const
{
	std::vector<drawPoint> points;
	
	float color2[] = {0.3f, 0.3f, 0.3f};

	// Fill background.
	
	points.push_back(drawPoint(col    , row    , 0));
	points.push_back(drawPoint(col + 1, row    , 0));
	points.push_back(drawPoint(col + 1, row + 1, 0));
	points.push_back(drawPoint(col    , row + 1, 0));
	
	drawInMode(GL_QUADS, points);
	points.clear();

	// Draw lines that seperate the bricks of the wall.
	setColor(color2[0], color2[1], color2[2]);

	// Verticals.
	points.push_back(drawPoint(col + 0.75, row + 0  , 0));
	points.push_back(drawPoint(col + 0.75, row + 0.5, 0));

	points.push_back(drawPoint(col + 0.25, row + 0.5, 0));
	points.push_back(drawPoint(col + 0.25, row + 1  , 0));

	// Horizontal.
	for (float f = 0; f <= 0.5; f += 0.5)
	{
		points.push_back(drawPoint(col + 0, row + f, 0));
		points.push_back(drawPoint(col + 1, row + f, 0));
	}

	drawInMode(GL_LINES, points);
	points.clear();
}